package com.xing.service.task;

import com.xing.service.mq.Sender;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by Bradish7Y on 2017/9/1.
 */
@Component
@Slf4j
public class MQSenderTask {
    @Resource
    private Sender sender;

    @Scheduled(cron = "0/30 * * * * *")
    public void send() {
        sender.send("生产消息/30s：" + String.valueOf(System.currentTimeMillis()));
    }
}
